<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Master extends Controller
{
  function Master()
  {
    parent::Controller();
    //$this->load->model('users','user', TRUE);
    $this->_set_scripts('jquery-1.2.2.pack.js');
  }
  
  function _set_scripts($var, $absolute_path = false) {
  	$value = '';
  	if (is_array($var)) {
  		foreach ($var as $v)
  			if (!$absolute_path)
					$value .= '<script language="javascript" type="text/javascript" src="'.base_url().'js/'.$v.'"></script>'."\n";
				else
					$value .= '<script language="javascript" type="text/javascript" src="'.$v.'"></script>'."\n";
  	}
  	else {
			if (!$absolute_path)
				$value .= '<script language="javascript" type="text/javascript" src="'.base_url().'js/'.$var.'"></script>'."\n";
			else
				$value .= '<script language="javascript" type="text/javascript" src="'.$var.'"></script>'."\n";
  	}
  	
  	if(array_key_exists('scripts', $this->load->_ci_cached_vars))
  		$this->load->_ci_cached_vars['scripts'] .= $value;
  	else
  		$this->load->vars(array('scripts' => $value));
  }
  
  function _set_css($var, $absolute_path = false) {
  	$value = '';
  	if (is_array($var)) {
  		foreach ($var as $v)
  			if (!$absolute_path)
					$value .= '<link rel="stylesheet" type="text/css" href="'.base_url().'css/'.$v.'"/>'."\n";
				else
					$value .= '<link rel="stylesheet" type="text/css" href="'.$v.'"/>'."\n";
  	}
  	else {
			if (!$absolute_path)
				$value .= '<link rel="stylesheet" type="text/css" href="'.base_url().'css/'.$var.'"/>'."\n";
			else
				$value .= '<link rel="stylesheet" type="text/css" href="'.$var.'"/>'."\n";
  	}
  	
  	if(array_key_exists('css', $this->load->_ci_cached_vars))
  		$this->load->_ci_cached_vars['css'] .= $value;
  	else
  		$this->load->vars(array('css' => $value));
  }
  
}
?>